// packageK/mycomponent/category-list/index.js
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    list: {
      type: Array,
      value: []
    },
    parentId: {
      type: Number,
      value: 0
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    emptyImg: 'https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/img_default.png',
  },

  /**
   * 组件的方法列表
   */
  methods: {
    /**
     * 子类点击跳转
     * @param {Object} e 
     */
    gotoCateList: function(e) {
      const { id } = e.currentTarget.dataset
      const { parentId } = this.data
      let url = parentId ? `/packageB/member/category/search_v2/search_v2?id=${id}` : `/packageB/member/category/brandgoods/brandgoods?id=${id}`
      wx.navigateTo({ url })
    },
  }
})